<?php
session_start();
ob_start('ob_gzhandler');
include_once('config.php');
$url_link = $_SERVER['REQUEST_URI'];
if(!@$_GET['user']){
	ob_start();
	$include = include_once('blocks/login.php');
	$include = ob_get_clean();
	$seo = $tc->seo($domain,title,description,keywords,$url_link);
}else{
	$user = $_GET['user'];
	$type = explode('_',$_GET['type']);
	$temp = $type[1];
	$type = $type[0];
	$album_id = $_GET['album'];
	if(@$album_id){
		$_SESSION['create_id_album'] = $album_id;
		$album_info = $tc->album_info($album_id);
		$row_album_info = mysql_fetch_array($album_info);
		$meta_title .= $row_album_info['name'].' - ';
	}
	include_once('blocks/user_quyen.php');
	
	$userinfo = $tc->user_info($user);
	if(mysql_num_rows($userinfo)==1){
		$friend = $tc->view_friend($user);
		$row_friend = mysql_fetch_array($friend);
		$m = explode(',',$row_friend['friend']);
		$total_friend = count($m)-1;
		
		$info_be = $tc->info_be($user);
		$row_info_be = mysql_fetch_array($info_be);
		$tuantuoi_data = $tc->view_tuanthai($row_info_be['tuantuoi']);
		
		$user_info = mysql_fetch_array($userinfo);
		ob_start();
		$include = include_once('blocks/user.php');
		$include = ob_get_clean();
	}else $include = '<p style="margin-top:60px; font-size:16px">Không có người dùng này</p>';
	
	$meta_title .= $user_info['name'].' - '.title;
	$meta_des .= $user_info['name'].' - '.title;
	$meta_key .= trim($userinfo['name'].','.keywords,',');
	$seo = $tc->seo($domain,$meta_title,$meta_des,$meta_key,$url_link);

	if($_GET['logout']==1){session_destroy(); header('location: http://'.$domain);}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php echo $seo; ?>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="library/jquery.corner.js"></script>
<script type="text/javascript" src="library/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="website.js"></script>
<script type='text/javascript'>//<![CDATA[
	var s=true;
	function doBlink(){
		$('.blink').css('display',function(index,val){
			s=!s;
			return (s)?'block':'none';
		})
	}
$(document).ready(function() {setInterval("doBlink()",0)});//]]>
</script>

<script src="library/scroll/jquery.mCustomScrollbar.concat.min.js"></script>
<script>
	(function($){
		$(window).load(function(){
			$("#news,#content_photo,#content_cungquan,#content_tuanthai,#view_notification").mCustomScrollbar({
				autoHideScrollbar:true,
				theme:"light-thin"
			});
		});
	})(jQuery);
</script>
</head>
<body>
<?php
if(@$_GET['user']) include_once('blocks/header.php');
echo '<div id="wrapper">'.$include.'</div>';
include_once('blocks/footer.php');
?>
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-41227817-1', 'umyli.com');
  ga('send', 'pageview');
</script>
</body>
</html>
<?php mysql_close();?>